//== SAGITTARIUS ============================================================================

//== BEGINNING OF CODE ===============================================================

#ifndef __SAGUTTARUIS__SESSION__H_
#define __SAGUTTARUIS__SESSION__H_

//== INCLUDES ========================================================================

#include "sagittarius/core/SagittariusCore.h"
#include "sagittarius/mem/pageheap.h"
#include "sagittarius/symtab/symtab.h"
#include "sagittarius/types/types.h"
#include "sagittarius/builtins/builtins.h"
#include "sagittarius/builtins/builtinfun.h"
#include "sagittarius/mod/modloader.h"


#ifdef __cplusplus
extern "C" {
#endif

typedef struct __sg_session {
    sg_smoheap smoheap;
    spanhash_t* smsh;
    builtin_type_ctx* bt;
    builtin_fun_ctx* bf;
    sg_standard_protos* pro;
    sg_mod_loader* ml;
    symtab* st;
    void* llvmu;
} sg_session;

sg_session* create_session();

void init_session(sg_session* s, symtab* st);

void session_init_symtable(sg_session* s, symtab* st);

void close_session(sg_session* s);

void release_session(sg_session* s);

//-- Global --

struct __sg_session* sg_global_session();

void sg_init_global_session(symtab* st);

void sg_close_global_session();

#ifdef __cplusplus
}//extern "C"
#endif

#endif
